(function() {
	const response = {
		type: 'page',
		name: "assetMaintenance",
		title: '资产维修申请列表',
		"toolbar": [
			{
				"type": "button",
				"label": "刷新",
				"onEvent": {
					"click": {
						"actions": [
							{
								"actionType": "refresh"
							}
						]
					}
				}
			}
		],
		body:[
			{
				label: "申请维修",
				type: "button",
				actionType: "dialog",
				level: "primary",
				className: "m-b-sm",
				dialog: {
					title: "维修申请",
					body: {
						type: "form",

						api: {
							method: "post",
							url: "/applicant/insertAssetMaintenance",
							data: "${assetId|toInt}"
						},
						body: [
							{
								type: "input-text",
								name: "assetId",
								label: "资产编号"
							}
						],
						"onEvent": {
							"submitSucc": {
								"weight": 0,
								"actions": [
									{
										"actionType": "refresh"
									}
								]
							}
						}
					}
				}
			},
			{
				type: "crud",
				name: "assetMaintenance",
				syncLocation: false,
				api: {
					method: "post",
					url: "/applicant/apGetAssetMaintenance",

				},
				"headerToolbar": [
					{
						"type": "export-excel",
						"api": "post:/applicant/apGetAssetMaintenance",
						filename: "维修记录",
						//自定义导出列
						// columns:[
						// 	"id",
						// 	"assetId",
						// 	"assetName",
						// 	"supplier",
						// 	"life",
						// 	"classes",
						// ]
					},{
						type: "reload"
					}
				],
				"autoFillHeight": true,
				loadDataOnce: true,
				columns:[
					{
						name: "id",
						label: "申请编号",
						// hidden: true
					},
					{
						name: "assetId",
						label: "资产编号"
					},
					{
						name: "applicantId",
						label: "申请人编号"
					},
					{
						name: "status",
						label: "申请时资产状态"
					},
					{
						name: "result",
						label: "维修进度"
					},
					{
						name: "isComplete",
						label: "维修申请状态"
					}
				]


			}
		]

	}

	window.jsonpCallback && window.jsonpCallback(response);
})();
